In part 4 of the app widget tutorial, we will learn how to implement adapter-based views into our home screen widget. For this we can use a ListView, GridView, AdapterViewFlipper or a StackView. Since the app widget is in another process, we have to use a RemoteViewsService that returns RemoteViewsFactory objects in it's onGetViewFactory method as a replacement for a normal adapter. In this class we have to implement onCreate, onDestroy, onDataSetChanged, getCount, getViewAt, getLoadingView, getViewTypeCount, getItemId and hasStableIds, which are similar to the methods of the normal adapter interface. We set this adapter on our widget with setRemoteAdapter and can additionaly define an empty view that will be displayed if our data set is empty with setEmptyView. In our manifest file we register our RemoteViewsService with the BIND_REMOTEVIEWS permission that can only be held by the Android system. With autoAdvanceViewId we can flip through our StackView automatically and with loopViews we can make it restart at card 1 after reaching the last card in the stack. Watch the whole playlist: https://www.youtube.com/playlist?list=PLrnPJCHvNZuDCoET8jL2VK4YVRNhVEy0K Example code for this part: https://gist.github.com/codinginflow/2d6a23eb66484bdc3cd6f6067174e630 ____________________ ⌨️ Watch me code LIVE on Twitch: https://www.twitch.tv/florianwalther 📺 Watch all my previous Twitch streams: https://www.youtube.com/channel/UCoAYgiwLuKgHbBHs7V6bc9w?sub_confirmation=1 ⭐ Get my MVVM Caching Course now: https://codinginflow.com/caching 📱 Check out my apps: https://codinginflow.com/apps ❗ Subscribe to the channel: https://www.youtube.com/c/codinginflow?sub_confirmation=1 💲 Earn money by becoming an affiliate for my courses: https://codinginflow.com/affiliate 📨 Subscribe to the Coding in Flow newsletter: https://codinginflow.com/newsletter 💻 Hire me for your next project: https://codinginflow.com/contact 💚 Donate to Coding in Flow with a message: https://paypal.me/codinginflow ❓ Ask your programming questions in our chat: https://discord.gg/TSnMvmc 📣 Follow Coding in Flow on other sites: Facebook: https://www.facebook.com/codinginflow Instagram: https://www.instagram.com/codinginflow TikTok: https://www.tiktok.com/@codinginflow Twitter: https://twitter.com/codinginflow Github: https://github.com/codinginflow 💰 Business requests, sponsoring, etc.: info@codinginflow.com